import { defHttp } from '@/utils/http/axios';
import {
  chatidParams,
  deptListParams,
  deptUserListParams,
  integralListParams,
  rankingListParams,
} from './model/deptModel';
import { BasicListResult, BasicDataResult } from '../model/baseModel';

import { ErrorMessageMode } from '#/axios';

enum Api {
  //Login = '/login',
  list = '/jz/sys/afterSalesManage/list',
  process = "/jz/sys/afterSalesManage/process",
  refund = "/jz/sys/afterSalesManage/refund",
  warehousing = "/jz/sys/afterSalesManage/warehousing",
  close = "/jz/sys/afterSalesManage/close",
  get= "/jz/sys/afterSalesManage/get",

}

/**
 * 售后列表
 */
export function listApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.list,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * 售后 审核通过
 */
export function processApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.process,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * 售后 审核拒绝
 */
export function refundApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.refund,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * 售后 入库
 */
export function warehousingApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.warehousing,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * 售后 close
 */
export function closeApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.close,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * 售后 详情
 */
export function getApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.get,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
